package com.cy.pj.goods.controller;


import com.cy.pj.goods.pojo.Goods;
import com.cy.pj.goods.service.GoodsService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;
@Controller
@RequestMapping("/goods/")
public class GoodsController {
    @Autowired
    private GoodsService goodsService;
    @GetMapping("doGoodsUI")
    public String doGoodsUI(Model model){
        List<Goods> goodsList=goodsService.findGoods();
        model.addAttribute("goodsList",goodsList);
        return  "goods";
    }
}
